<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	template="template/ui.xhtml">
	<ui:define name="body">
		<h3>Welcome to JSF Lab</h3>
		<h4>Pure JSF TEst</h4>
		<h:form id="jsfForm">
			<h:inputText id="name" value="#{mainController.name}" />
			<h:commandButton value="Say Hi">
    			<f:ajax execute="name" render=":jsfForm:nameGroup" />
			</h:commandButton>
			<br />
			<h:panelGroup id="nameGroup">
				<h:outputText value="Hi #{mainController.name}!!" 
					rendered="#{not empty mainController.name}"/>
			</h:panelGroup>
		</h:form>
		<hr/>
		<h4>PrimeFaces</h4>
		<h:form id="primeForm">
			<p:inputText id="name" value="#{mainController.primeName}">
				<p:ajax event="keyup" process="@this" update=":primeForm:nameGroup" />
			</p:inputText>
			<h:panelGroup id="nameGroup">
				<h:outputText value="Hi #{mainController.primeName}!!" 
					rendered="#{not empty mainController.primeName}" />
			</h:panelGroup>
			<br></br>
			<h:commandButton action="#{mainController.processPage2}" value="Page2" />
			<br></br>
			<p:gmap center="41.381542, 2.122893" zoom="15" type="HYBRID" style="width:600px;height:400px" />
		</h:form>
	</ui:define>
</ui:composition>